package com.itheima.order.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.itheima.common.pojo.TbOrder;
import com.itheima.order.mapper.OrderMapper;
import com.itheima.order.service.OrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @作者 itcast
 * @创建日期 2020/10/17 14:19
 **/
@Service
@Transactional
public class OrderServiceImpl implements OrderService {
    @Autowired
    OrderMapper orderMapper;
    @Override
    public List<TbOrder> findOrderByUserId(String username) {
        return orderMapper.selectList(
                Wrappers.<TbOrder>lambdaQuery().eq(TbOrder::getUsername,username)
        );
    }
}
